package track2.experiment;

import track2.context.Config;
import track2.context.LRConfig;
import track2.linear.LRFeatures;
import track2.linear.LRformula;
import track2.linear.LinearRegression;
import track2.result.Result;
import track2.result.ResultFileTool;

public class LRExperiment {
	
	//training test for LRExperiment
	public static void main(String[] args){
		LRFeatures feature = LRFeatures.getObject(Config.lrFeaturePath);
		LinearRegression.outputMeanFeatures(feature, Config.trainingFilePath, Config.lrTrainFilePath);
		boolean[] choose = {true, true, true, true, true, true, true, true};
		LRformula formula = LinearRegression.trainLinearModel(choose);
		formula.print();
		LRformula.putObject(formula);
		
		feature = LRFeatures.getObject(LRConfig.LRAllFeaturePath);
//		LRFeatures.putObject(feature, LRConfig.LRAllFeaturePath);
		
		Result result = LinearRegression.testLinearModel(choose, feature, formula, Config.testFilePath);
		ResultFileTool.outputResult(result, Config.lrTestFilePath);
		
		result = LinearRegression.testLinearModel(choose, feature, formula, Config.sampleTestFilePath);
		ResultFileTool.outputResult(result, Config.lrSampleTestFilePath);
		
	}

}
